/**************************************************************************************
*		              LED?????												  *
????:?????LED???????????????
????:?																				  
***************************************************************************************/

#include "reg52.h"			 //????????????????????
#include<intrins.h>		//??????????,?????????

typedef unsigned int u16;	  //???????????
typedef unsigned char u8;

#define led P2	   //?P2????led ???????led??P2?

/*******************************************************************************
* ? ? ?         : delay
* ????		   : ????,i=1?,????10us
*******************************************************************************/
void delay(u16 i)
{
	while(i--);	
}

/*******************************************************************************
* ? ? ?       : main
* ????		 : ???
* ?    ?       : ?
* ?    ?    	 : ?
*******************************************************************************/
void main()
{
	u8 i;
	led=0xfe;
	delay(50000); //????450ms	
	while(1)
	{	
/*		for(i=0;i<8;i++)
		{
			P2=~(0x01<<i);	 //?1??i?,??????????P2?
			delay(50000); //????450ms
		}
*/		
		for(i=0;i<7;i++)	 //?led????
		{
			led=_crol_(led,1);
			delay(50000); //????450ms	
		}
		for(i=0;i<7;i++)	//?led????
		{
			led=_cror_(led,1);
			delay(50000); //????450ms	
		}	
	}		
}